package com.JaMorant.SSM.thc.controller;


import com.JaMorant.SSM.result.Result;
import com.JaMorant.SSM.thc.service.GoodsConfigService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

/**
 * 导入快递
 */
@RestController
@RequestMapping(value = "/admin/goodsConfig")
public class GoodsConfigController {

    @Autowired
    private GoodsConfigService goodsConfigService;



    //城市分类导入
    //城市分类导入
    @ApiOperation("一包商品配置价格")
    @PostMapping("/importData")
    public Result importData(MultipartFile file) {
        goodsConfigService.importData(file);
        return Result.ok(null);
    }

    @ApiOperation("计算商品试用装配置价格")
    @PostMapping("/calGoodsPrice")
    public Result calGoodsPrice(MultipartFile file) {
        goodsConfigService.calGoodsPrice(file);
        return Result.ok(null);
    }

    @ApiOperation("计算商品试用装15片价格")
    @PostMapping("/calGoodsPrice2")
    public Result calGoodsPrice2() {
        goodsConfigService.calGoodsPrice2();
        return Result.ok(null);
    }

}

